/**
 * 
 */
package com.pawelthiel.persistence.dao;

import java.util.List;

import javax.persistence.PersistenceException;

import com.pawelthiel.persistence.entity.AbstractEntity;
import com.pawelthiel.persistence.to.AbstractTO;

/**
 * @author Simon
 *
 */
public interface IDataAccessObject<T extends AbstractTO> {
	
	public AbstractTO select(int pk) throws PersistenceException, com.framework.exceptions.PersistenceException;
	
	public T findByFilter(int key);
	
	public T findByFilter(String key);
	
	public Integer getPrimaryKey(AbstractEntity entity);
	
	public List<T> selectAll() ;
	
	public void insert(AbstractTO to) throws com.framework.exceptions.PersistenceException;
	
	public void update(AbstractTO to) throws com.framework.exceptions.PersistenceException;
	
	public void delete(AbstractTO to) throws com.framework.exceptions.PersistenceException;

}
